import request from '@/utils/request'

/**
 * 分页获取
 */
export function getIncomeByPage(params, pageNum, pageSize, token) {
    return request({
        url: '/income/list/page',
        method: 'get',
        params: {
            ...params,
            pageNum,
            pageSize,
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 保存
 */
export function addOrUpdateIncome(data, token) {
    return request({
        url: '/income/addOrUpdate',
        method: 'post',
        params: {
            ...data
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 收入信息详情
 */
export function getIncomeDetail(id, token) {
    return request({
        url: '/income/getIncomeDetail/' + id,
        method: 'get',
        headers: {
            'token': token
        }
    })
}

/**
 * 删除收入信息
 */
export function delIncomeById(id, token) {
    return request({
        url: '/income/delIncomeById/' + id,
        method: 'post',
        headers: {
            'token': token
        }
    })
}